package com.zhongdone.pattern.structural.adapter.objectAdapter;

/**
 * 适配器
 */
public class PowerAdapter implements DC5 {

    private AC220 ac220;

    public PowerAdapter(AC220 ac220){
        this.ac220 = ac220;
    }

    @Override
    public Integer outputDC5V() {
        Integer adapterInput = this.ac220.outputAC220V();
        Integer adapterOutput = adapterInput/44;
        System.out.println("使用Adapter输入AC"+adapterInput+"V， 输出DC"+adapterOutput+"V");
        return adapterOutput;
    }


    public static void main(String[] args) {
        DC5 dc5 = new PowerAdapter(new AC220());
        dc5.outputDC5V();
    }
}
